package com.wframe.project.jnd.vo;

import java.util.Date;
import java.util.LinkedList;

/**
 * Created by lwb on 2017/7/5.
 */
public class Composition implements Comparable {
    private String promotionId;
    private LinkedList<PriceBeanVo> prices;
    private Date updateTime = new Date();

    public String getPromotionId() {
        return promotionId;
    }

    public void setPromotionId(String promotionId) {
        this.promotionId = promotionId;
    }

    public LinkedList<PriceBeanVo> getPrices() {
        return prices;
    }

    public void setPrices(LinkedList<PriceBeanVo> prices) {
        this.prices = prices;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    public int compareTo(Object obj) {
        if (obj instanceof Composition) {
            Composition composition = (Composition) obj;
            int weight = this.updateTime.compareTo(composition.updateTime);
            if (weight == 0) {
                weight = this.promotionId.compareTo(composition.promotionId);
            }
            return weight;
        }
        return 0;
    }
}
